package javamusic.Servlet.Cliente;

import java.io.IOException;


import javamusic.excepcion.DAOExcepcion;

import javamusic.modelo.Cliente;
import javamusic.modelo.Sala;

import javamusic.negocio.GestionCliente;
import javamusic.negocio.GestionSala;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.catalina.Session;



/**
 * Servlet implementation class ServletClienteReservaEditar
 */
@WebServlet("/ServletClienteReservaEditar")
public class ServletClienteReservaEditar extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ServletClienteReservaEditar() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		//${sessionScope.USUARIO_ACTUAL.correo}
		//String  correo = "#{sessionScope.USUARIO_ACTUAL.correo}";
		 
		
		
		
		String nombre = request.getParameter("nombre");

		
		
		
		GestionSala negocio = new GestionSala();
		GestionCliente negocio1 = new GestionCliente();
		GestionCliente negocio2 = new GestionCliente();
		
		try{
			Sala vo = negocio.obtenerpornombre(nombre);
	
			Cliente vo1 = negocio1.obtenerpornombresala(nombre);
			Cliente vo2 = negocio2.obtenerpornombre(nombre);
			
			
	
		
		request.setAttribute("SALAS", vo);
		request.setAttribute("LOCALES", vo1);
		request.setAttribute("LOCALES1", vo2);
		
		
} catch (DAOExcepcion e){
	System.out.println(e.getMessage());
	RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
	
	rd.forward(request, response);
}
		
		
RequestDispatcher rd = request.getRequestDispatcher("FormReservaClienteNuevo.jsp");
rd.forward(request, response);
		
	}
	
		
	

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
